package com.zuipin.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zuipin.entity.Member;
import com.zuipin.entity.OrderInfoLog;
import com.zuipin.mapper.OrderInfoLogMapper;
import com.zuipin.service.IMemberService;
import com.zuipin.service.IOrderInfoLogService;
import com.zuipin.util.Pagination;

@Service
public class OrderInfoLogServiceImpl implements IOrderInfoLogService {
	@Resource
	private OrderInfoLogMapper	orderInfoLogMapper;
	@Resource
	private IMemberService		memberService;
	
	@Override
	public List<OrderInfoLog> findOrderInfoLogList(String orderNo, Pagination page) {
		List<OrderInfoLog> list = orderInfoLogMapper.findOrderInfoLogList(orderNo, page);
		for (OrderInfoLog log : list) {
			if (log.getSysUserId() != null) {
				log.setUpdatorName("系统用户:" + "******");
			} else if (log.getMemberId() != null) {
				Member member = memberService.findById(log.getMemberId());
				log.setUpdatorName("商城用户:" + member.getContactName());
			}
		}
		return list;
	}
}
